﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>会员套餐列表-微街秀管理后台</title>
<style>
/*分页*/
.pager_style{width:100%;height:30px;margin-top:10px;text-align:left;color:#909090;}
.pager_style li{font-size:14px;}
.pager_style .page_num{height:100%;font-size:0;display:inline-block; float:left;}
.pager_style .page_num li{height:100%;border:1px solid #eeeeee;padding:0 10px;margin-right:5px;line-height:30px;display:inline-block;cursor:pointer;float:left;}
.pager_style .page_num li:hover{border:1px solid #f37b0b;background-color:#f37b0b;color:White;}

/*分页 选中当页样式*/
.pager_style .page_num .active{border:1px solid #f37b0b;background-color:#f37b0b;color:White;cursor:default;}
/*分页 不可用样式*/
.pager_style .page_num .disable{background-color:#f1f1f1;}
.pager_style .page_num .disable:hover{border:1px solid #eeeeee;background-color:#f1f1f1;color:#909090;}

.pager_style .page_info{display:inline-block;float:left;}
.pager_style .page_info li{display:inline-block;margin-left:10px;float:left;line-height: 30px;}
</style>
    <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="../js/base.js" type="text/javascript"></script>
    <script src="../js/ajax-data.js" type="text/javascript"></script>
    <script src="../js/Pager.js" type="text/javascript"></script>
    <script src="../js/dialog.js" type="text/javascript"></script>
    <style>
        table{border-collapse: collapse;border: none;width: 980px; text-align:center;}
        td{border: solid #ccc 1px;color:Black; height:26px;}
        td a{ text-decoration:none;}
        .td1,.td2,.td3,.td6{width:120px; font-weight:bold; text-align:center;}
        .td4,.td5{width:250px; font-weight:bold; text-align:center;}
    </style>
</head>
<body>
<div style="width:980px; margin-left:auto; margin-right:auto;">
<h2 style="width:980px; text-align:center;">套餐列表</h2>
<div id="username"></div>
<div  style=" float:right;"><input type="button" id="Add" value="添加套餐" />
<input type="button" id="Button1" value="返回" onclick="window.location.href='list.html'" /></div>

  <table id="list">
        <tr>
            <td>ID</td>
            <td>套餐</td>
            <td>开始日期</td>
            <td>到期时间</td>
            <td>操作</td>
        </tr>
    </table>
 

</div>
 <script>

     $(function () {
         islogin();
         GetList(1);
         $("#Add").click(function () {
             window.location.href = "setting.html?user_id=" + getUrlArgStr("id");
         });
         $("#username").html("用户名："+ decodeURI(getUrlArgStr("name")));
     })

     function GetList(page) {
         AjaxStart("../ajax/UserVersion.ashx?getpalist", "pageindex=1&userid=" + getUrlArgStr("id"), function (data) {
             if (data.code != 0)
                 alert(data.msg);
             else {
                 $("#list").html("");
                 var list = data.item.table;
                 var html = "<tr><td class='td1'>ID</td><td class='td2'>套餐</td><td class='td4'>开始日期</td><td class='td5'>到期日期</td><td class='td6'>操作</td></tr>";
                 for (var i = 0; i < list.length; i++) {
                     html += "<tr>";
                     html += "<td>" + list[i].id + "</td>";
                     html += "<td>" + list[i].version_name + "</td>";
              
                     html += "<td>" + list[i].date + "</td>";
                     html += "<td>" + list[i].end_date + "</td>";
                     html += "<td><a id=\"" + list[i].id + "\" class='Cencanl' href='#'>取消</a></td>";
                     html += "</tr>";
                 }
                 $("#list").html(html);
             }
             $(".Cencanl").click(function () {
                 AjaxStart("../ajax/UserVersion.ashx?cancenl", "userid="+ getUrlArgStr("id")+"&id=" + $(this).attr("id"), function (data) {
                     if (data.code == 0)
                         GetList(1);
                 });
             });
         });
        
     }
    
 </script>
</body>
</html>
